package com.xuecheng.teaching.convert;

import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import com.xuecheng.api.teaching.model.dto.CompanyDTO;
import com.xuecheng.api.teaching.model.dto.WorkDTO;
import com.xuecheng.api.teaching.model.vo.WorkVo;
import com.xuecheng.teaching.entity.Company;
import com.xuecheng.teaching.entity.Work;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface WorkConvert {
    WorkConvert INSTANCE = Mappers.getMapper(WorkConvert.class);

    //po转换dto
    @Mapping(source = "id", target = "workId")
    WorkDTO entity2dto(Work work);

    List<WorkDTO> entitys2dtos(List<Work> entitys);

    //dot转换为po
   @Mapping(source = "workId", target = "id")
    Work dto2entity(WorkDTO workDTO);

   //vo转换为dto
   WorkDTO vo2dto(WorkVo workVo);






}
